package com.younion.factory;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 功能：主框架的bean工厂
 */
public class MainframeBeanFactory implements ApplicationContextAware {

	private static ApplicationContext applicationContext;
	private static MainframeBeanFactory instance;

	//void duplicate initial
	private MainframeBeanFactory() {
	}

	public MainframeBeanFactory getInstance() {
		if(instance == null)
			instance = new MainframeBeanFactory();
		return instance;
	}
	

	public static ApplicationContext getBeanFactory() {
		return applicationContext;
	}

	public void setApplicationContext(ApplicationContext applicationContext) {  
		MainframeBeanFactory.applicationContext = applicationContext;  
    }

}